home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 2 (Sweden) / BackPacker 2 (Sweden) (Disc 1).7z / BackPacker 2 (Sweden) (Disc 1).bin / pc / instdata / inst0024 / 00047.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  1.0 KB  |  36 lines

  1. on ImportExternalSavedGame
  2.   global gRsrcPath
  3.   if the machineType = 256 then
  4.     set F to FileIO(mnew, "?READ", ".TXT")
  5.   else
  6.     set F to FileIO(mnew, "?READ", "TEXT")
  7.   end if
  8.   if objectp(F) then
  9.     set impotxt to F(mReadFile)
  10.     F(mdispose)
  11.     if not impotxt contains "--- BackPacker 2" then
  12.       abort()
  13.     end if
  14.     set F to FileIO(mnew, "READ", FixPath(gRsrcPath & "BP2SAVED\INDEX.IIF"))
  15.     if objectp(F) then
  16.       set IndexText to F(mReadFile)
  17.       F(mdispose)
  18.       set SGL to value(line 2 of IndexText)
  19.       if count(SGL) > 0 then
  20.         set Index to integer(char 3 to 8 of getAt(SGL, count(SGL))) + 1
  21.       else
  22.         set Index to 1
  23.       end if
  24.       set fileName to "SG" & FixFileIndex(Index) & ".BPD"
  25.       set F to FileIO(mnew, "WRITE", FixPath(gRsrcPath & "BP2SAVED\" & fileName))
  26.       if objectp(F) then
  27.         set err to F(mWriteString, impotxt)
  28.         F(mdispose)
  29.         if err then
  30.           alert(line 2 of field "MenuErrorMessages")
  31.         end if
  32.       end if
  33.     end if
  34.   end if
  35. end
  36.